package com.fsc.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fsc.entity.domain.StudentInfo;
import com.fsc.entity.domain.TeacherInfo;
import com.fsc.entity.dto.StudentDTO;
import com.fsc.entity.dto.TeacherDTO;
import com.fsc.mapper.TeacherInfoMapper;
import com.fsc.service.StudentInfoService;
import com.fsc.mapper.StudentInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
* @author 86183
* @description 针对表【student_info(学生信息表)】的数据库操作Service实现
* @createDate 2024-06-02 13:15:22
*/
@Service
public class StudentInfoServiceImpl extends ServiceImpl<StudentInfoMapper, StudentInfo>
    implements StudentInfoService{

    @Autowired
    private StudentInfoMapper studentInfoMapper;

    @Override
    public List<StudentInfo> getAllStudents() {
        return studentInfoMapper.getAllStudents();
    }

    @Override
    public List<StudentInfo> getStudentsByTeacherId(int teacherId) {
        return studentInfoMapper.getStudentsByTeacherId(teacherId);
    }

    @Override
    public List<StudentInfo> getStudentsByParentId(int parentId) {
        return studentInfoMapper.getStudentsByParentId(parentId);
    }

    @Override
    public String getStudentNameById(int studentId) {
        return studentInfoMapper.getStudentNameById(studentId);
    }

    public StudentInfo select(int studentId){
        return studentInfoMapper.getStudentById(studentId);
    }

    public void update(StudentDTO studentDTO){
       studentInfoMapper.update(studentDTO);
    }
}




